using RimWorld;

namespace Verse.AI.Group;

public class Trigger_TraderAndAllTraderCaravanGuardsLost : Trigger
{
	public override bool ActivateOn(Lord lord, TriggerSignal signal)
	{
		if (signal.type == TriggerSignalType.PawnLost)
		{
			for (int i = 0; i < lord.ownedPawns.Count; i++)
			{
				TraderCaravanRole traderCaravanRole = lord.ownedPawns[i].GetTraderCaravanRole();
				if (traderCaravanRole == TraderCaravanRole.Trader || traderCaravanRole == TraderCaravanRole.Guard)
				{
					return false;
				}
			}
			return true;
		}
		return false;
	}
}
